<template>
  <div>
    <van-sticky>
      <div class="navbar">
        <van-icon class="navcross" name="arrow-left" @click="go" />
        <span class="nav-title">商品详情</span>
      </div>
    </van-sticky>
  </div>
</template>

<script>
export default {
  name: "Navbar",
  methods: {
    go() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped>
.navbar {
  position: relative;
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #ccc;
  height: 0.45rem;
  line-height: 0.45rem;
}
.navcross {
  position: absolute;
  padding-left: 0.2rem;
  margin-top: 0.13rem;
  color: darkred;
  font-size: 0.2rem;
}
.nav-title {
  display: block;
  font-size: 0.18rem;
  text-align: center;
}
</style>